package com.ddyx.rest;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ddyx.service.IEmployeService;
import com.ddyx.service.IGoodsService;
import com.ddyx.service.IGuideService;
import com.ddyx.service.IStoreGoodsService;
import com.ddyx.service.IStoreService;
import com.ddyx.service.user.UEmployeService;
import com.ddyx.service.user.UStoreService;
import com.ddyx.util.RequestForm;
import com.ddyx.util.ResponseForm;

@Controller
@RequestMapping("/home")
public class WxUserHomeController {
	
	@Resource
	IStoreGoodsService storeGoodsService;
	
	@Resource
	IStoreService iStoreService;
	@Resource
	UStoreService usService;
	
	@Resource
	IGoodsService iGoodsService;
	
	@Resource
	IEmployeService iEmployService;
	
	@Resource
	IGuideService guideService;
	
	@Resource
	UEmployeService ueService;
	
	/**
	 * 获取商品列表
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getStoreGoods", method = RequestMethod.POST)
	public ResponseForm selectwxGood(@RequestBody RequestForm requestForm) {
		return storeGoodsService.getStoreGoods(requestForm);
	}
	/**
	 * 根据商品id 查询商品详情接口
	 * @param requestForm
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getGoodsDetails", method = RequestMethod.POST)
	public ResponseForm selectwxGoodInfoById(@RequestBody RequestForm requestForm) {
		return storeGoodsService.getGoodsDetails(requestForm);
	}
	
	/**
	 * 根据storeNo 获取 指定门店的详细信息
	 * 该接口用于专门获取门店信息
	 */
	@ResponseBody
	@RequestMapping(value = "/getStoreDetails" , method = RequestMethod.POST)
	public ResponseForm getStoreDetails(@RequestBody RequestForm param) {
		return usService.getStoreDetails(param);
	}
	
	/**
	 * 获取多门店顶部信息数据
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "getIndexTop" , method = RequestMethod.POST)
	public ResponseForm getIndexTop(@RequestBody RequestForm param) {
		return iGoodsService.getIndexTop(param);
	}
	
	/**
	 * 获取多门店首页 多门店商品展示信息
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "getGoodsShow" , method = RequestMethod.POST)
	public ResponseForm getGoodsShow(@RequestBody RequestForm param) {
		return iGoodsService.getGoodsShow(param);
	}
	/**
	 * 获取导购员信息
	 * @param param
	 * @return
	 * @throws Exception 
	 */
	@ResponseBody
	@RequestMapping(value ="getGuide",method = RequestMethod.POST)
	public ResponseForm getGuide(@RequestBody RequestForm param) throws Exception {
		return ueService.getGuide(param);
	}
	
	/**
	 * 导购服务通知
	 * @param param
	 * @throws Exception 
	 */
	@ResponseBody
	@RequestMapping(value="guideServiceNotification",method = RequestMethod.POST)
	public void guideServiceNotification(@RequestBody RequestForm param) throws Exception {
		guideService.guideServiceNotification(param);
	}
	
}
